package thread.disruptor.parallel;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;
import org.jetbrains.annotations.NotNull;
import thread.disruptor.generate1.Trade;

/**
 * Created by Try on 2017/6/11.
 */
public class Handler4 implements EventHandler<Trade>, WorkHandler<Trade> {

    @Override
    public void onEvent(Trade trade, long sequence, boolean endOfBatch) throws Exception {
        this.onEvent(trade);
    }

    @Override
    public void onEvent(@NotNull Trade trade) throws Exception {
        System.out.println(Thread.currentThread().getName()+"  ==>handler4: get name:" + trade.getName());
        trade.setName(trade.getName() + "h4");
    }
}
